package yl.hs.bmipfull.controllers.dataCockpit;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.dataCockpit.IProjectEngineeringService;
import yl.hs.bmipfull.viewmodels.WebResult;
import yl.hs.bmipfull.viewmodels.dataCockpit.EngineeringVo;

import java.util.List;

/**
 * @author 韩纪旺
 * @apiNote
 * @since 2022/9/20 14:51 创建
 */
@Api(value = "数据驾驶舱-项目工程", tags = "数据驾驶舱-项目工程")
@RestController
@RequestMapping(value = "/api/ProjectEngineering")
public class ProjectEngineeringController  extends ControllerBase {

    @Autowired
    IProjectEngineeringService service;


    @ApiOperation(value = "项目工程--项目基本情况", notes = "项目基本情况")
    @RequestMapping(value = "BasicInformation",method = RequestMethod.GET)
    public WebResult BasicInformation() {
        return  success("OK",service.getBasicInformation());
    }

    @ApiOperation(value = "项目工程--各项目发货重量分析", notes = "各项目发货重量分析")
    @RequestMapping(value = "weightAnalysis",method = RequestMethod.GET)
    public WebResult weightAnalysis() {


        return success("ok",service.weightAnalysis());
    }

    @ApiOperation(value = "项目工程--客户重量排行榜", notes = "客户重量排行榜")
    @RequestMapping(value = "customerRanking/{timeType}",method = RequestMethod.GET)
    public WebResult customerRanking(@ApiParam(value = "时间类型")@PathVariable String timeType ) {
        List<EngineeringVo> engineeringVos = service.customerRanking(timeType);
        if(engineeringVos.size()==0){
            return success("未查询到数据");
        }
        return success("ok",engineeringVos);

    }

    @ApiOperation(value = "项目工程--区域发货量榜", notes = "项目工程区域发货量榜")
    @RequestMapping(value = "regionalDelivery",method = RequestMethod.GET)
    public WebResult regionalDelivery() {

        return success("ok",service.regionalDelivery());

    }

    @ApiOperation(value = "项目工程--项目工程热力地图", notes = "项目工程热力地图")
    @RequestMapping(value = "thermalMap",method = RequestMethod.GET)
    public WebResult thermalMap() {


        return success("ok", service.thermalMap());
    }


}







